choice random word in python from a text file

111

choice random word in python from a text file -

import random
print(random.choice(open('file.txt').read().split()).strip())

Comments

Submit
0 Comments